<?php


namespace App\Http\Request\System\Term;


use App\Common\Utils\BaseRequest;

class editRequest extends BaseRequest
{

    public function rules() {
        $rules = [
            'id' => 'required|integer|min:1',
            'year' => 'required|max:30',
            'termname' => 'required|max:30',
            'startdate' => 'required|date',
            'enddate' => 'required|date',
        ];

        return $rules;
    }

    public function messages() {
        $messages = [
            'id.required' => 'id不能为空',
            'id.integer' => 'id为整数',
            'id.min' => 'id必须大于0',
            'year.required' => '学年名称不能为空',
            'year.max' => '学期名称长度不能超过30',
            'termname.required' => '学期名称不能为空',
            'termname.max' => '学期名称长度不能超过30',
            'startdate.required' => '学期开始时间不能为空',
            'startdate.date' => '学期开始时间必须为日期',
            'enddate.required' => '学期结束时间不能为空',
            'enddate.date' => '学期结束时间必须为日期',
        ];

        return $messages;
    }
}
